home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 …ember: Reference Library / Dev.CD Dec 00 RL Disk 1.toast / pc / technical documentation / develop / develop issue 26 / develop issue 26 code / truffles - display mgr. / sprocket / sources / utilityclasses.cp < prev    next >
Encoding:
Text File  |  1996-01-01  |  572 b   |  35 lines

  1. /*
  2.     File:        UtilityClasses.cp
  3.  
  4.     Contains:    Useful utility functions when using the Drag Manager.
  5.  
  6.     Written by: Dave Falkenburg
  7.  
  8.     Copyright:    © 1993-1996 by Dave Falkenburg, all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.      
  12.  */
  13.  
  14. #include "UtilityClasses.h"
  15.  
  16.  
  17. TGraphicsContext::TGraphicsContext(GrafPtr aPort)
  18.     {
  19.     GetPort(&fOldPort);
  20.     SetPort(aPort);
  21.     
  22.     fOldClip = NewRgn();
  23.     GetClip(fOldClip);
  24.     GetPenState(&fOldPenState);
  25.     }
  26.  
  27.  
  28. TGraphicsContext::~TGraphicsContext()
  29.     {
  30.     SetClip(fOldClip);
  31.     DisposeRgn(fOldClip);
  32.     SetPenState(&fOldPenState);
  33.     SetPort(fOldPort);
  34.     }
  35.